package com.csi.config;

import com.csi.inteceptor.FullInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new FullInterceptor())
                .addPathPatterns("/**")//拦截所有请求
                .excludePathPatterns("/user/**","regist","/swagger-ui/**/**"
                        ,"/index/**","/v3/**"
                        ,"/login/","/role/**"
                        ,"token/**");//除了登录和注册页面
    }
}
